

module.exports = {
    playSkinId:"0",
    playSkill:[0,1,2,3,4],
    playSkillLevel:[1,1,1,1,1],


    gold:0,
    lastGetGoldTime:0,
    curLevel:1,//关卡等级
    
    save:function(playdate)
    {
        console.log(" playSkillLevel[1] "+playdate. playSkillLevel[1] );
        cc.sys.localStorage.setItem("playdate",JSON.stringify(playdate));
    },
    loadPlayDate:function(playdate)
    {
        if(cc.sys.localStorage.getItem("playdate") == null)
      
       {
            var lastGetGoldTime = new Date();
            playdate.lastGetGoldTime = lastGetGoldTime.getTime();
            console.log(" playdate.lastGetGoldTime "+ playdate.lastGetGoldTime );
            playdate.save(playdate);
       }

            var tt   = JSON.parse(cc.sys.localStorage.getItem("playdate"));
            playdate.playSkinId = tt.playSkinId;
            playdate.playSkill = tt.playSkill;
            playdate.playSkillLevel = tt.playSkillLevel;
            
        console.log(" playSkillLevel[1] "+playdate. playSkillLevel[1] );
            playdate.gold = tt.gold;
            playdate.lastGetGoldTime = tt.lastGetGoldTime;
            playdate.curLevel = tt.curLevel;

            return playdate;
    //    }
    },
}